<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        function fun() {
            console.log('这是 fun 函数');
        }

        fun.foo = function () {
            console.log('这是一个静态函数');
        }

        fun.prototype.foo = function () {
            console.log('这是原型对象方法');
        }
        fun();
        fun.foo();

        console.log(new fun());
        new fun().foo();

        function person() {
            console.log('这是 person');
        }
        person();

        person.fn = function () {
            console.log('这是 person函数的静态方法');
        }
        person.fn();

        var p1 = new person();
    </script>
</body>

</html>